package com.example.javabasic.thread.classtwo.lock.demo2;

/**
 * @author Administrator
 */
public class User extends Thread {
    private final Door door;
    private final String name;
    private final String address;

    public User(Door door, String name, String address) {
        this.door = door;
        this.name = name;
        this.address = address;
    }

    @Override
    public void run() {
        System.out.println("开始"+name);
        while(true){
            this.door.pass(name,address);
        }

    }
}
